package frank.zou.fit.casestudy.order;

public class WholeSaleOrder {

	  private int numberOfCases;
	  private ProductType productType;	
	  private Money pricePerCase;	
	  private double discount;

	  public double getDiscount() {
	    return discount;
	  }

	  public void setDiscount(double discount) {
	    this.discount = discount;
	  }

	  public Money getCalculatedPrice() {
	    Money totalPrice = this.pricePerCase.multiply(this.numberOfCases);
	    Money tmpPrice = totalPrice.multiply(this.discount);
	     return totalPrice.substract(tmpPrice);
	  }

	  public Money getDiscountedDifference() {        
	    Money totalPrice = this.pricePerCase.multiply(this.numberOfCases);
	    return totalPrice.substract(this.getCalculatedPrice());
	  }

	  public int getNumberOfCases() {
	    return numberOfCases;
	  }

	  public void setNumberOfCases(int numberOfCases) {
	    this.numberOfCases = numberOfCases;
	  }

	  public void setProductType(ProductType productType) {
	    this.productType = productType;
	  }

	  public String getProductType() {
	    return productType.getName();
	  }

	  public void setPricePerCase(Money pricePerCase) {
	    this.pricePerCase = pricePerCase;
	  }

	  public Money getPricePerCase() {
	    return pricePerCase;
	  }	
	}